import request from '@/utils/request';
import settings from '../../../config/defaultSettings';
export async function GetUserByPage(params: any) {
  return request(`${settings.prefixUrl}/system/user/getUserByPage`, {
    method: 'POST',
    data: params,
  });
}

export async function AddUser(params: any) {
  return request(`${settings.prefixUrl}/system/user/addUser`, {
    method: 'POST',
    data: params,
  });
}

export async function updateUser(params: any) {
  return request(`${settings.prefixUrl}/system/user/updateUser`, {
    method: 'POST',
    data: params,
  });
}

export async function DelUser(params: any) {
  return request(`${settings.prefixUrl}/system/user/delUser`, {
    method: 'POST',
    data: params,
  });
}

export async function LockUser(params: any) {
  return request(`${settings.prefixUrl}/system/user/lockUser`, {
    method: 'POST',
    data: params,
  });
}

export async function loadTransferUserRelRoler(params: any) {
  return request(`${settings.prefixUrl}/system/user/loadTransferUserRelRole`, {
    method: 'POST',
    data: params,
  });
}

export async function saveRolesByUserId(params: any) {
  return request(`${settings.prefixUrl}/system/user/saveRolesByUserId`, {
    method: 'POST',
    data: params,
  });
}

/**
 *
 * @param params
 * @returns
 */
export async function updatePassword(params: any) {
  return request(`${settings.prefixUrl}/system/user/updatePassword`, {
    method: 'POST',
    data: params,
  });
}

export async function uploadAvatar(params: any) {
  return request(`${settings.prefixUrl}/system/user/uploadAvatar`, {
    method: 'POST',
    requestType: 'form',
    data: params,
  });
}

export async function ReLogin(params: any) {
  console.log('Simple====');
  return request(`${settings.prefixUrl}/system/user/reLoin`, {
    method: 'POST',
    data: params,
  });
}

export async function getRoleList() {
  return request(`${settings.prefixUrl}/system/role/getRoleList`, {
    method: 'POST',
    // data: params,
  });
}

export async function GetUserInfo() {
  return request(`${settings.prefixUrl}/system/user/viewBaseInfo`, {
    method: 'POST',
    // data: params,
  });
}
